import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:untitled/utils/SnackBarHepler.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      scaffoldMessengerKey: ScaffoldMessengerGlobalKey,
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage>
    with SingleTickerProviderStateMixin {
  double selectValue = 1.0;
  @override
  Widget build(BuildContext context) {
    //脚手架
    return Scaffold(
      appBar: AppBar(
        title: Text('进度条'),
        backgroundColor: Colors.blue,
        foregroundColor: Colors.white,
      ),

      body: SizedBox.expand(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            LinearProgressIndicator(
              //背景颜色
              backgroundColor: Colors.grey,
              //进度的颜色
              valueColor: AlwaysStoppedAnimation(Colors.blue),
            ),

            SizedBox(height: 60),
            LinearProgressIndicator(
              //固定进度
              value: 0.6,
            ),

            SizedBox(height: 60),

            CircularProgressIndicator(backgroundColor: Colors.grey[100]),
            SizedBox(height: 60),
            CircularProgressIndicator(
              value: 0.6,
              backgroundColor: Colors.grey[100],
              valueColor: AlwaysStoppedAnimation(Colors.red),
            ),

            SizedBox(height: 60),

            CupertinoActivityIndicator(radius: 10, color: Colors.red),
          ],
        ),
      ),
    );
  }
}
